//
//  ViewController.swift
//  MXButton_Test
//
//  Created by 陈学明 on 2018/2/8.
//  Copyright © 2018年 sinaAging. All rights reserved.
//

import UIKit
let w = UIScreen.main.bounds.size.width
let H = UIScreen.main.bounds.size.height

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        let BtnV1 = MXButton.button(frame: CGRect(x: 10, y: 10, width: 200, height: 100),
                                    imageSize: CGSize(width: 50, height: 50),
                                    type: .ImageToRight)
        BtnV1.image(nor: UIImage(named: "iphone"),
                    select: UIImage(named: "iphone"))
        BtnV1.titleColor(nor: UIColor.white,
                         select: UIColor.blue)
        BtnV1.title(nor: "文字",
                    select: "选中了")
        BtnV1.backgroundColor = UIColor.orange
        BtnV1.textfont = UIFont.systemFont(ofSize: 30)
        view.addSubview(BtnV1)
        
        let BtnV2 = MXButton.button(frame: CGRect(x: 10, y: BtnV1.frame.maxY + 20, width: 200, height: 100),
                                    imageSize: CGSize(width: 50, height: 50),
                                    type: .ImageToTop)
        BtnV2.image(nor: UIImage(named: "iphone"),
                    select: UIImage(named: "iphone"))
        BtnV2.titleColor(nor: UIColor.white,
                         select: UIColor.blue)
        BtnV2.title(nor: "文字",
                    select: "选中了")
        BtnV2.backgroundColor = UIColor.orange
        BtnV2.textfont = UIFont.systemFont(ofSize: 50)
        view.addSubview(BtnV2)
        let BtnV3 = MXButton.button(frame: CGRect(x: 10, y: BtnV2.frame.maxY + 20, width: 200, height: 100),
                                    imageSize: CGSize(width: 50, height: 50),
                                    type: .ImageToBottom)
        BtnV3.image(nor: UIImage(named: "iphone"),
                    select: UIImage(named: "iphone"))
        BtnV3.titleColor(nor: UIColor.white,
                         select: UIColor.blue)
        BtnV3.title(nor: "文字啦啦啦",
                    select: "选中了")
        BtnV3.backgroundColor = UIColor.orange
        view.addSubview(BtnV3)
        
        let BtnV4 = MXButton.button(frame: CGRect(x: 10, y: BtnV3.frame.maxY + 20, width: 200, height: 100),
                                    imageSize: CGSize(width: 50, height: 50),
                                    type: .ImageToLeft)
        BtnV4.image(nor: UIImage(named: "iphone"),
                    select: UIImage(named: "iphone"))
        BtnV4.titleColor(nor: UIColor.white,
                         select: UIColor.blue)
        BtnV4.title(nor: "",
                    select: "选中了😄")
        BtnV4.backgroundColor = UIColor.orange
        view.addSubview(BtnV4)
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        
    }
}

